package com.feifei.service.impl;

import com.feifei.bean.Comment;
import com.feifei.mapper.CommentMapper;
import com.feifei.service.CommentService;
import com.feifei.vo.CommentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;
    @Override
    public List<CommentVO> getCommentsByProductId(Integer product_id) {
        List<CommentVO> commentVOList=commentMapper.getCommentsByProductId(product_id);
        return commentVOList;
    }

    @Override
    public int addComment(Comment comment) {
        int i=commentMapper.insertSelective(comment);
        return i;
    }
}
